export const formActionProps = {
  showSearchBtn: {
    type: Boolean,
    default: true
  },
  showResetBtn: {
    type: Boolean,
    default: true
  },
  searchText: {
    type: String,
    default: '查询'
  },
  resetText: {
    type: String,
    default: '重置'
  }
}

export const basicProps = {
  // lable是否显示冒号
  colon: {
    type: Boolean,
    default: true
  },
  // 表单配置项
  schemas: {
    type: Array,
    default: () => []
  },
  // 栅格布局
  colProps: {
    type: Object,
    default: () => ({})
  },
  labelWidth: {
    type: String,
    default: '100px'
  },
  // 表单域标签的位置，如果值为 left 或者 right 时，则需要设置 label-width
  labelPosition: {
    type: String,
    default: 'right'
  },
  // 是否显示操作按钮
  showActionButtonGroup: {
    type: Boolean,
    default: true
  },
  // 是否按下回车查询
  isEnterSearch: {
    type: Boolean,
    default: true
  },
  theme: {
    type: String,
    default: ''
  },
  rules: {
    type: Object,
    default: () => ({})
  },
  // 表单项的 margin-bottom
  formItemMb: {
    type: String,
    default: '16px'
  },
  // 是否开启自适应布局
  isFlex: {
    type: Boolean,
    default: true
  },
  // 尺寸，不同的lebel设置不同的尺寸以适应屏幕, 设置此属性必须设置isFlex为true
  formSize: {
    type: String,
    default: 'default'
  },
  model: {
    type: Object,
    default: () => ({})
  },
  ...formActionProps
}

export const fromItemProps = {
  // label是否显示冒号
  colon: {
    type: Boolean,
    default: true
  },
  // 字段名称
  prop: {
    type: String,
    required: true
  },
  component: {
    type: String,
    required: true
  },
  label: String,
  labelWidth: {
    type: String,
    default: '100px'
  },
  required: {
    type: Boolean,
    default: false
  },
  // 显示隐藏
  show: {
    type: Boolean,
    default: true
  },
  value: {
    type: [Number, String, Boolean, Array, Date],
    default: ''
  },
  defaultValue: {
    type: [Number, String, Boolean, Array, Date],
    default: ''
  },
  // 栅格布局
  colProps: {
    type: Object,
    default: () => ({})
  },
  rules: {
    type: Array,
    default: () => []
  },
  componentProps: {
    type: Object,
    default: () => ({})
  },
  disabled: {
    type: Boolean,
    default: false
  },
  slots: {
    type: String,
    default: ''
  },
  // 渲染内容, 需要返回渲染函数，否则会报错
  renderContent: {
    type: Function,
    default: null
  },
  formItemMb: {
    type: String,
    default: '16px'
  }
}
